# 内置特殊的实例方法： __call_
class Person():
  pass

  def __call__(self, *args, **kwargs):
    print('xxx', *args)
    print(args[0],args[1])
    print(kwargs)
    print(kwargs['name'])
    print(108*'-')

    print(args)
    print(*args)

p = Person()

p(123,345,name='wyl350')


class PenFactory:
  def __init__(self,type):
    self.p_type = type

  def __call__(self, color):
    print(f'创建了一个{self.p_type}的画笔，他的颜色是{color}的')

gangbi = PenFactory('钢笔')
gangbi('红色')
gangbi('绿色')

铅笔 = PenFactory('铅笔')
铅笔('红色')
铅笔('绿色')


